UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i+NJ3UcFeYATLBFaGH54A8RNuV9G3Ge42a82OaNfYHE=' 
WHERE 
  key_id = '26ee71144985d9edc9faeeaba7366f16e1cd4ed5fcf9506337cf78b312428fa7' 
  AND (
    token = 'i+NJ3UcFeYATLBFaGH54A8RNuV9G3Ge42a82OaNfYHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027