UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehZ5Ch4c7V4oSVfy/q/nTrBm+2OrKZJoTJSMqDvHBtI=' 
WHERE 
  key_id = 'e0e00393980b408e16fffb9d608a8e586c808d63c5656fd7fc848a1c6a3839e3' 
  AND (
    token = 'ehZ5Ch4c7V4oSVfy/q/nTrBm+2OrKZJoTJSMqDvHBtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018