UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zCgsPY4hQ2ShVt6ZE1FBJDGq+2iEeEG41r8bE9W0CFE='
WHERE
key_id = '3bbcfcd1a4d315e1726f8aa62bb9f1ea2b207aee43016702483d190fdb359566'
AND (
token = 'zCgsPY4hQ2ShVt6ZE1FBJDGq+2iEeEG41r8bE9W0CFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)