UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tb+C8byPLpZDWNwrY+zw4FW30RM2u/Ar9qVznGN6xEM=' 
WHERE 
  key_id = 'ddeb3128278e90e39da2d593c2543b8df6e54e4986914db8c8449b5e82985a26' 
  AND (
    token = 'Tb+C8byPLpZDWNwrY+zw4FW30RM2u/Ar9qVznGN6xEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031