UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cdcKbcyFJMIi/urYGnur8wxeatT1CvihMkwVBjnv7wM='
WHERE
key_id = '75da2c581c878c5392162e869b51eb9d1a0bdc2c1d4dea955594b6fc6f0a96ed'
AND (
token = 'cdcKbcyFJMIi/urYGnur8wxeatT1CvihMkwVBjnv7wM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)