UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3QWnoFrb54QJIJYOEL5or1WtaDZKtyPjvf5qgt/y4u4='
WHERE
key_id = '1ad82ae5796f2163eea3667583137804abd250f81ccbc7bfeff5abac483f0806'
AND (
token = '3QWnoFrb54QJIJYOEL5or1WtaDZKtyPjvf5qgt/y4u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)