UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zWuYDN+q3eFnnB6X13MdSSc0m+X/PhEoTL4rbyaXen4='
WHERE
key_id = '92d1bbe89f6a152a2aecba0b9af946b2212713d709c97ad0d9fd8e055b940aca'
AND (
token = 'zWuYDN+q3eFnnB6X13MdSSc0m+X/PhEoTL4rbyaXen4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)