UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OMsZvfxBgA8v5x3TbOBSwsO5lSxBftNLr9OOyCVePDo=' 
WHERE 
  key_id = '2ed43901e8a6c9ec27fa1d9c1541f2a4f6eb64429b69db3dc00f73408d878b01' 
  AND (
    token = 'OMsZvfxBgA8v5x3TbOBSwsO5lSxBftNLr9OOyCVePDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074