UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EzyJRkvEF123lMw9ITbZM7YzbubUpQBWVLoPOpJiO3k='
WHERE
key_id = 'fbcb0a38d4b73efb6cc2e0405c7681379de4d4687e2e41420ea526e223cdf772'
AND (
token = 'EzyJRkvEF123lMw9ITbZM7YzbubUpQBWVLoPOpJiO3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)