UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+EeaNqHeg5FtXHP3wnUqUdzsDo0vxf+NCD2/aJflAWw='
WHERE
key_id = 'ac8530eb96c7f895c606a06de3b29104d2c934eeeaf6735e5bef2e1447df19df'
AND (
token = '+EeaNqHeg5FtXHP3wnUqUdzsDo0vxf+NCD2/aJflAWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)