UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+3NxDyoyesHoIMBMnZWRcR0qEzz92I8dD/7mIVURGs='
WHERE
key_id = 'd7542025e5fe75b7c5201b6fa685623a3147891888ae93edea4d1e4e04d7af2a'
AND (
token = 'U+3NxDyoyesHoIMBMnZWRcR0qEzz92I8dD/7mIVURGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)