UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GpLT18i3OwbTd7G301/dLvS73g2xSW0a3rIYuHRZfSY='
WHERE
key_id = '4f8242772bbfc0420c23639763fcc9019bd1a41261b9de735a4b3a659af42c8a'
AND (
token = 'GpLT18i3OwbTd7G301/dLvS73g2xSW0a3rIYuHRZfSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)