UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gGI7byI6E77G4jNr9mAPsg5WVaALpFaHB0q0Ba0rt5o='
WHERE
key_id = 'd9266cdbbba9430f03481876747de13e81eced05918cc66dc24aadde07c8ea64'
AND (
token = 'gGI7byI6E77G4jNr9mAPsg5WVaALpFaHB0q0Ba0rt5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)