UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9V+7nA8Ac/LFtwa/B9xhZZzaWAp3e0G/bJ2Xg40zmpQ=' 
WHERE 
  key_id = 'ff26fac764846a904ade2f372ae20d88dee9521cfd2e5117702b3c8520db1978' 
  AND (
    token = '9V+7nA8Ac/LFtwa/B9xhZZzaWAp3e0G/bJ2Xg40zmpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035