UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qmhm+luROji0nHfBGQ1CRnqUPit3wvti5aEcWijn9E4=' 
WHERE 
  key_id = 'f854cc9277f99644fa68051d9d47dcbfb9d3d09836ece2994ded8d8cb9ceba80' 
  AND (
    token = 'Qmhm+luROji0nHfBGQ1CRnqUPit3wvti5aEcWijn9E4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033