UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rCmUNGF+MEs628Jt94hkDfxDHVPdOC6y79+eI2AZBI=' 
WHERE 
  key_id = '78be6f3d2d67634192e757ec264f574a775fecb3f112080cbe4529533419e5b2' 
  AND (
    token = '1rCmUNGF+MEs628Jt94hkDfxDHVPdOC6y79+eI2AZBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024