UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bvINPlawNM18DD9yz16pao95XxpsYwLOU5eNno9ao4='
WHERE
key_id = 'f8be17e1fb8969d4a6bc4002194eb028bfd073b85a9f9db952da296b1b58c88a'
AND (
token = '/bvINPlawNM18DD9yz16pao95XxpsYwLOU5eNno9ao4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)