UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HOvlHI43U7c/MMOIodMyPSduQCX3jNLILsZvD3yx9zk='
WHERE
key_id = '764ff1dc39344a51c25fcaec54dcfa8a95e4108efa0d0d52a55a26c5ade49230'
AND (
token = 'HOvlHI43U7c/MMOIodMyPSduQCX3jNLILsZvD3yx9zk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)