UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PmyQvvEhHiw/PvBulKCjUcJBFkwJiCj3166jy87Lo9k='
WHERE
key_id = '6219e14b50b7cc7b7c4beaeac818f0ad645db8ac4004c6082be4da78c76fb2e2'
AND (
token = 'PmyQvvEhHiw/PvBulKCjUcJBFkwJiCj3166jy87Lo9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)