UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YGZXhQTnU19YLayU8lflX8Q+4Pvl0+6H/h4+uGQDExE=' 
WHERE 
  key_id = '78f1dced0569e0e16a5bdfb3402fc485242116901dae2a625b6c9b3572acb4da' 
  AND (
    token = 'YGZXhQTnU19YLayU8lflX8Q+4Pvl0+6H/h4+uGQDExE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017