UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xGsTMLAYkRx8ovwce2ZpqHOh9JxYJ1rGY4kmO3CqTiY='
WHERE
key_id = '6d8106430ce0240c2d131d4b582b87c7c75d7f640b68532405849538593a8de0'
AND (
token = 'xGsTMLAYkRx8ovwce2ZpqHOh9JxYJ1rGY4kmO3CqTiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)