UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Kfgl/zo13UOR3ovgifIY05RWMbbWIK11CbPMZTYHYs=' 
WHERE 
  key_id = '729e6b9a9e359dab8af09d5627c837a02e2b6bdb0876a0efe5e9b7da9b99b762' 
  AND (
    token = '5Kfgl/zo13UOR3ovgifIY05RWMbbWIK11CbPMZTYHYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025