UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8yXe1GXeK03m0bGuds/kAWbH0wvTaEy3YyZ6W5EdV0w='
WHERE
key_id = '0768a4668d8f5b172943da34a5831b92b81ef98dcdbb6cc79cb0fd9d0e6c2188'
AND (
token = '8yXe1GXeK03m0bGuds/kAWbH0wvTaEy3YyZ6W5EdV0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)