UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BKmpjedyk6YAjG6YxAmP83rnE/BUFDp7NNByyqYyDWE=' 
WHERE 
  key_id = 'cd2f5bf58b368fe0a82f0b38bcd3d3dea45b2731feb5cf2facdf25406cbf8c96' 
  AND (
    token = 'BKmpjedyk6YAjG6YxAmP83rnE/BUFDp7NNByyqYyDWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043