UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tMN/dtaGqJEFeYIVI49/9kyQ9ybhkK6WA2NEdBECebw='
WHERE
key_id = '054ccda8098fccbc8bd32aeffb2db606aa3cabf566d8983efcd65d81c0002a1b'
AND (
token = 'tMN/dtaGqJEFeYIVI49/9kyQ9ybhkK6WA2NEdBECebw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)