UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lRSlKSHSeIq9gXGMdtsKHLreBWGMj2KQ+HDi5NOwX1Q='
WHERE
key_id = '692425651ecde1b81c8c3132b4c669ab08ae42f2965a15b6ac1d99783d70f560'
AND (
token = 'lRSlKSHSeIq9gXGMdtsKHLreBWGMj2KQ+HDi5NOwX1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)