UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xid8VrrplT7QwmKULLESbE51lICbTMmmfDyKrrn/LE8=' 
WHERE 
  key_id = '926d23c9939dd2fb410b3f354b2f3fa17a4798b5143a542b22618f351c356e27' 
  AND (
    token = 'Xid8VrrplT7QwmKULLESbE51lICbTMmmfDyKrrn/LE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046