UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '07gVpiMUEdRr82p+hxfMR6Y8sH9rZQVSQqf1zjuF0mI='
WHERE
key_id = '8b1a1751a8b50f8d1145299e99195111885381682d29a5a9b9da0f35e1614b25'
AND (
token = '07gVpiMUEdRr82p+hxfMR6Y8sH9rZQVSQqf1zjuF0mI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)