UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w98EAZD8M29Z+d0MIlL5hAVDPk9ZHrEVJlf5ZH/WnUg='
WHERE
key_id = '1eca9899008a11489e95cdfb5d3a84e8d0fd516418a9f3c1335b8ff3a365627c'
AND (
token = 'w98EAZD8M29Z+d0MIlL5hAVDPk9ZHrEVJlf5ZH/WnUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)