UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hULxOoZBAy8a/p7g+Myfr/LNk8c83OCUvGP7uv2h9Pk='
WHERE
key_id = 'aa3caae6fa618c701aba6fc05b70d759fab99de019638d7e7f49812cafdf8d31'
AND (
token = 'hULxOoZBAy8a/p7g+Myfr/LNk8c83OCUvGP7uv2h9Pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)