UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cnhj5SIF/9nk9qe7C7YYbuPWWilfXHQ+A9TgYNQTg1c=' 
WHERE 
  key_id = '2e61257555e87ba1915801a6f9fe6df89823f57bdcb65525a082e8e6f03650aa' 
  AND (
    token = 'cnhj5SIF/9nk9qe7C7YYbuPWWilfXHQ+A9TgYNQTg1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027