UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd0+z+MALKV26YzEcNzgxzoWYLNCUxYuCuRLLv/kqaJU='
WHERE
key_id = 'fb31ec93d1d2a2ba6c821cefa82db4dc54c81f4dd0cb082f2e50176e8aab85a9'
AND (
token = 'd0+z+MALKV26YzEcNzgxzoWYLNCUxYuCuRLLv/kqaJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)